home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1998-02-12 | 16.1 KB | 538 lines | [ TEXT/MPS ]
; ; File: InstallerScript.a ; ; Contains: xxx put contents here xxx ; ; Version: Technology: Installer 4.5 ; Package: 4.5 ; ; Copyright: © 1984-1998 by Apple Computer, Inc. ; All rights reserved. ; ; Bugs?: If you find a problem with this file, use the Apple Bug Reporter ; stack. Include the file and version information (from above) ; in the problem description and send to: ; Internet: apple.bugs@applelink.apple.com ; AppleLink: APPLE.BUGS ; ; IF &TYPE('__INSTALLERSCRIPT__') = 'UNDEFINED' THEN __INSTALLERSCRIPT__ SET 1 IF &TYPE('__FILES__') = 'UNDEFINED' THEN include 'Files.a' ENDIF ; include 'Types.a' ; ; include 'ConditionalMacros.a' ; ; include 'MixedMode.a' ; ; include 'OSUtils.a' ; ; include 'Memory.a' ; ; include 'Patches.a' ; ; include 'Kernel.a' ; ; include 'Errors.a' ; ; include 'MachineExceptions.a' ; ; include 'Timing.a' ; ; include 'OrderedItems.a' ; ; include 'Finder.a' ; IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN include 'Memory.a' ENDIF IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN include 'MixedMode.a' ENDIF IF &TYPE('__TYPES__') = 'UNDEFINED' THEN include 'Types.a' ENDIF kMaxNumOfFunctionParams EQU 12 CallBackPBRec RECORD 0 fSelector ds.l 1 ; offset: $0 (0) fResult ds.l 1 ; offset: $4 (4) fParam ds.l 12 ; offset: $8 (8) sizeof EQU * ; size: $38 (56) ENDR ; typedef struct CallBackPBRec CallBackPBRec ; typedef CallBackPBRec *CallBackPBPtr ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Rule Function ; ; ; Code Resource Calling Interface: ; ; long YourRuleFunction( RuleFunctionPBPtr ); ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// kTRUERuleFunctionResult EQU 1 kFALSERuleFunctionResult EQU 0 RuleFunctionPBRec RECORD 0 fCallBackProcPtr ds.l 1 ; offset: $0 (0) fTargetVRefNum ds.w 1 ; offset: $4 (4) fTargetFolderDirID ds.l 1 ; offset: $6 (6) fSystemVRefNum ds.w 1 ; offset: $A (10) fSystemBlessedDirID ds.l 1 ; offset: $C (12) fRefCon ds.l 1 ; offset: $10 (16) sizeof EQU * ; size: $14 (20) ENDR ; typedef struct RuleFunctionPBRec RuleFunctionPBRec ; typedef RuleFunctionPBRec *RuleFunctionPBPtr ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Action Atom Function ; ; ; Code Resource Calling Interface: ; ; long YourActionAtomFunction( ActionAtom2PBPtr ); ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// before EQU 0 after EQU 1 cleanUpCancel EQU 2 ; typedef SInt8 InstallationStage kActionAtomResultFatalError EQU -1 kActionAtomResultContinue EQU 0 kActionAtomResultCancel EQU 1 ; typedef long ActionAtomResult ActionAtom2PBRec RECORD 0 fMessageID ds.b 1 ; offset: $0 (0) padByte ds.b 1 ; offset: $1 (1) fStaticDataHdl ds.l 1 ; offset: $2 (2) fCallBackProcPtr ds.l 1 ; offset: $6 (6) fTargetVRefNum ds.w 1 ; offset: $A (10) fTargetFolderDirID ds.l 1 ; offset: $C (12) fSystemVRefNum ds.w 1 ; offset: $10 (16) fSystemBlessedDirID ds.l 1 ; offset: $12 (18) fRefCon ds.l 1 ; offset: $16 (22) fDoingInstall ds.b 1 ; offset: $1A (26) fDidLiveUpdate ds.b 1 ; offset: $1B (27) fInstallerTempDirID ds.l 1 ; offset: $1C (28) sizeof EQU * ; size: $20 (32) ENDR ; typedef struct ActionAtom2PBRec ActionAtom2PBRec ; typedef ActionAtom2PBRec *ActionAtom2PBPtr ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Version Compare Function ; ; ; Code Resource Calling Interface: ; ; long YourComputeVersionFunctionSetupFunction( ComputeVersionPBPtr ); ; ; Return the version in BCD format. For example: ver 2.0.1 final release is 0x02018000 ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// ComputeVersionPB RECORD 0 fCallBackProcPtr ds.l 1 ; offset: $0 (0) sizeof EQU * ; size: $4 (4) ENDR ; typedef struct ComputeVersionPB ComputeVersionPB ; typedef ComputeVersionPB *ComputeVersionPBPtr ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Target Search Function ; ; ; Code Resource Calling Interface: ; ; SearchResult YourTargetSearchFunction( SearchProcedurePBPtr ); ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// kFatalSearchError EQU -1 kSearchSuccessful EQU 0 kCancelSearchAndInstallation EQU 1 ; typedef SInt8 SearchResult FoundFileRec RECORD 0 vRefNum ds.w 1 ; offset: $0 (0) parID ds.l 1 ; offset: $2 (2) name ds.l 16 ; offset: $6 (6) fReferenceID ds.w 1 ; offset: $46 (70) sizeof EQU * ; size: $48 (72) ENDR ; typedef struct FoundFileRec FoundFileRec ; typedef FoundFileRec *FoundFileArrayPtr ; typedef FoundFileArrayPtr *FoundFileArrayHdl SearchProcedurePBRec RECORD 0 fCallBackProcPtr ds.l 1 ; offset: $0 (0) fTargetVRefNum ds.w 1 ; offset: $4 (4) fTargetFolderDirID ds.l 1 ; offset: $6 (6) fSystemVRefNum ds.w 1 ; offset: $A (10) fSystemBlessedDirID ds.l 1 ; offset: $C (12) fRefCon ds.l 1 ; offset: $10 (16) fFileSpecType ds.l 1 ; offset: $14 (20) fFileSpecCreator ds.l 1 ; offset: $18 (24) fFileSpecCrDate ds.l 1 ; offset: $1C (28) fFileSpecPath ds.l 64 ; offset: $20 (32) fFoundFilesArray ds.l 1 ; offset: $120 (288) sizeof EQU * ; size: $124 (292) ENDR ; typedef struct SearchProcedurePBRec SearchProcedurePBRec ; typedef SearchProcedurePBRec *SearchProcedurePBPtr ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Setup Function ; ; ; Code Resource Calling Interface: ; ; long YourSetupFunction( EnvironmentSetupPBPtr ); ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// kContinueInstallerSetup EQU 0 kQuitInstallerNow EQU -1 EnvironmentSetupPB RECORD 0 fCallBackProcPtr ds.l 1 ; offset: $0 (0) fTargetFSSpec ds FSSpec ; offset: $4 (4) fSystemVRefNum ds.w 1 ; offset: $4A (74) sizeof EQU * ; size: $4C (76) ENDR ; typedef struct EnvironmentSetupPB EnvironmentSetupPB ; typedef EnvironmentSetupPB *EnvironmentSetupPBPtr ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Atom Extender Function ; ; ; Code Resource Calling Interface: ; ; long YourAtomExtenderFunction( ExtenderPBPtr ); ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// kFileAtomDataFork EQU 0 kFileAtomRsrcFork EQU 1 kFileAtomRsrcForkFromDataFork EQU 2 kRsrcAtom EQU 3 kFontAtom EQU 4 kActionAtom EQU 5 ; typedef SInt8 DataType kFatalError EQU -1 kContinueAsNormal EQU 0 kCancelInstallation EQU 1 kCopiedData EQU 2 ; typedef SInt16 ExtenderResultCode kInitialize EQU 0 kBeforePart EQU 1 kAfterPart EQU 2 kSuccess EQU 3 kCancel EQU 4 ; typedef SInt8 ExtenderMessageID EnvironsHeaderRec RECORD 0 fMessageID ds.b 1 ; offset: $0 (0) pad1 ds.b 1 ; offset: $1 (1) fStaticDataHdl ds.l 1 ; offset: $2 (2) fCallBackProcPtr ds.l 1 ; offset: $6 (6) fTargetVRefNum ds.w 1 ; offset: $A (10) fTargetFolderDirID ds.l 1 ; offset: $C (12) fSystemVRefNum ds.w 1 ; offset: $10 (16) fSystemBlessedDirID ds.l 1 ; offset: $12 (18) fRefCon ds.l 1 ; offset: $16 (22) fDataType ds.b 1 ; offset: $1A (26) pad2 ds.b 1 ; offset: $1B (27) sizeof EQU * ; size: $1C (28) ENDR ; typedef struct EnvironsHeaderRec EnvironsHeaderRec CopyHeaderRec RECORD 0 fSourceFile ds FSSpec ; offset: $0 (0) fTargetFile ds FSSpec ; offset: $46 (70) fTotalTargetSize ds.l 1 ; offset: $8C (140) fTargetPosStart ds.l 1 ; offset: $90 (144) fTargetPartSize ds.l 1 ; offset: $94 (148) fSourcePartSize ds.l 1 ; offset: $98 (152) fInstallerTempDirID ds.l 1 ; offset: $9C (156) sizeof EQU * ; size: $A0 (160) ENDR ; typedef struct CopyHeaderRec CopyHeaderRec BasicCopyRec RECORD 0 fEnvironmentHeader ds EnvironsHeaderRec ; offset: $0 (0) fCopyPBHeader ds CopyHeaderRec ; offset: $1C (28) sizeof EQU * ; size: $BC (188) ENDR ; typedef struct BasicCopyRec BasicCopyRec RsrcCopyRec RECORD 0 fEnvironmentHeader ds EnvironsHeaderRec ; offset: $0 (0) fCopyPBHeader ds CopyHeaderRec ; offset: $1C (28) fSourceRsrcType ds.l 1 ; offset: $BC (188) fSourceRsrcID ds.w 1 ; offset: $C0 (192) fTargetRsrcType ds.l 1 ; offset: $C2 (194) fTargetRsrcID ds.w 1 ; offset: $C6 (198) fTargetRsrcName ds.l 64 ; offset: $C8 (200) fTargetRsrcAttrs ds.w 1 ; offset: $1C8 (456) sizeof EQU * ; size: $1CA (458) ENDR ; typedef struct RsrcCopyRec RsrcCopyRec FontCopyRec RECORD 0 fEnvironmentHeader ds EnvironsHeaderRec ; offset: $0 (0) fCopyPBHeader ds CopyHeaderRec ; offset: $1C (28) fSourceFontRsrcType ds.l 1 ; offset: $BC (188) fSourceFontRsrcID ds.w 1 ; offset: $C0 (192) fTargetFontRsrcType ds.l 1 ; offset: $C2 (194) ; FONT, NFNT, or sfnt fTargetFontRsrcID ds.w 1 ; offset: $C6 (198) fTargetFontRsrcName ds.l 64 ; offset: $C8 (200) fTargetFontRsrcAttrs ds.w 1 ; offset: $1C8 (456) fFamilyName ds.l 64 ; offset: $1CA (458) fFamilyID ds.w 1 ; offset: $2CA (714) fFontSize ds.w 1 ; offset: $2CC (716) fFontStyle ds.w 1 ; offset: $2CE (718) sizeof EQU * ; size: $2D0 (720) ENDR ; typedef struct FontCopyRec FontCopyRec ExtenderPBRec RECORD 0 fBasicPBRec ds BasicCopyRec ; offset: $0 (0) ORG 0 fFileCopyPBRec ds BasicCopyRec ; offset: $0 (0) ORG 0 fRsrcCopyPBRec ds RsrcCopyRec ; offset: $0 (0) ORG 0 fFontCopyPBRec ds FontCopyRec ; offset: $0 (0) ORG 720 sizeof EQU * ; size: $2D0 (720) ENDR ; typedef union ExtenderPBRec ExtenderPBRec ; typedef ExtenderPBRec *ExtenderPBPtr ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Callback Glue Routines ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; Memory Related ; ; pascal Handle INewHandle(InstallerCallBackUPP pCallBackProcPtr, unsigned long newHandleSize) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION INewHandle ENDIF ; ; pascal void IDisposHandle(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION IDisposHandle ENDIF ; ; pascal void IHLock(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION IHLock ENDIF ; ; pascal void IHUnLock(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION IHUnLock ENDIF ; Atom Extender Related ; ; pascal OSErr ReadSourceData(InstallerCallBackUPP pCallBackProcPtr, long *count, Ptr storagePtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION ReadSourceData ENDIF ; ; pascal OSErr WriteTargetData(InstallerCallBackUPP pCallBackProcPtr, long count, Ptr storagePtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION WriteTargetData ENDIF ; ; pascal OSErr ReadTargetData(InstallerCallBackUPP pCallBackProcPtr, long *count, Ptr storagePtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION ReadTargetData ENDIF ; ; pascal OSErr SetTargetDataPos(InstallerCallBackUPP pCallBackProcPtr, short positionMode, long positionOffset) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION SetTargetDataPos ENDIF ; ; pascal OSErr GetTargetDataPos(InstallerCallBackUPP pCallBackProcPtr, long *positionOffset) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION GetTargetDataPos ENDIF ; ; pascal OSErr GetTargetDataEOF(InstallerCallBackUPP pCallBackProcPtr, long *theLength) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION GetTargetDataEOF ENDIF ; ; pascal OSErr SetSourceDataPos(InstallerCallBackUPP pCallBackProcPtr, short positionMode, long positionOffset) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION SetSourceDataPos ENDIF ; ; pascal OSErr GetSourceDataPos(InstallerCallBackUPP pCallBackProcPtr, long *positionOffset) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION GetSourceDataPos ENDIF ; ; pascal OSErr GetSourceDataEOF(InstallerCallBackUPP pCallBackProcPtr, long *theLength) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION GetSourceDataEOF ENDIF ; Action Atom Related ; ; pascal OSErr MakeFSSpecFromFileSpecID(InstallerCallBackUPP pCallBackProcPtr, short pFileSpecID, FSSpec *pFSSpecPtr, StringHandle *pExtraPathInfo) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION MakeFSSpecFromFileSpecID ENDIF ; ; pascal void SuspendWaitCursor(InstallerCallBackUPP pCallBackProcPtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION SuspendWaitCursor ENDIF ; ; pascal void ResumeWaitCursor(InstallerCallBackUPP pCallBackProcPtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION ResumeWaitCursor ENDIF ; ; pascal void IncrementStatusBar(InstallerCallBackUPP pCallBackProcPtr, short pIncrementAmount) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION IncrementStatusBar ENDIF ; ; pascal Boolean IsUserInteractionAllowed(InstallerCallBackUPP pCallBackProcPtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION IsUserInteractionAllowed ENDIF ; ; pascal OSErr InstallerFindSpecialFolder(InstallerCallBackUPP pCallBackProcPtr, short pVRefNum, OSType pfolderType, Boolean pCreateFolder, short *pFoundVRefNum, long *pFoundDirID) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION InstallerFindSpecialFolder ENDIF ; ; pascal long GetBoxFlagOverwrite(InstallerCallBackUPP pCallBackProcPtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION GetBoxFlagOverwrite ENDIF ; ; pascal Boolean IsLaunchedByUpgrader(InstallerCallBackUPP pCallBackProcPtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION IsLaunchedByUpgrader ENDIF ; ; pascal Boolean IsParasiteScript(InstallerCallBackUPP pCallBackProcPtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION IsParasiteScript ENDIF ; ; pascal void RegisterScriptAction(InstallerCallBackUPP pCallBackProcPtr, short actionClassID, short actionIdentifier, void *param0, void *param1, void *param2, void *param3, void *resultPtr) ; IF GENERATINGCFM THEN IMPORT_CFM_FUNCTION RegisterScriptAction ENDIF ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; ; Obsolete Interfaces ; ;/////////////////////////////////////////////////////////////////////////////////////////////////// ; Old Action Atom Parameter Block AAPBRec RECORD 0 targetVRefNum ds.w 1 ; offset: $0 (0) blessedDirID ds.l 1 ; offset: $2 (2) aaRefCon ds.l 1 ; offset: $6 (6) doingInstall ds.b 1 ; offset: $A (10) whichStage ds.b 1 ; offset: $B (11) didLiveUpdate ds.b 1 ; offset: $C (12) padByte ds.b 1 ; offset: $D (13) installerTempDirID ds.l 1 ; offset: $E (14) sizeof EQU * ; size: $12 (18) ENDR ; typedef struct AAPBRec AAPBRec ; typedef AAPBRec *AAPBRecPtr ; Action Handler Parameter Block ActionHandlerPB RECORD 0 fStaticDataHdl ds.l 1 ; offset: $0 (0) fCallBackProcPtr ds.l 1 ; offset: $4 (4) fTargetVRefNum ds.w 1 ; offset: $8 (8) fTargetFolderDirID ds.l 1 ; offset: $A (10) fSystemVRefNum ds.w 1 ; offset: $E (14) fSystemBlessedDirID ds.l 1 ; offset: $10 (16) fActionClassID ds.w 1 ; offset: $14 (20) fActionIdentifier ds.w 1 ; offset: $16 (22) fParam0 ds.l 1 ; offset: $18 (24) fParam1 ds.l 1 ; offset: $1C (28) fParam2 ds.l 1 ; offset: $20 (32) fParam3 ds.l 1 ; offset: $24 (36) fResultPtr ds.l 1 ; offset: $28 (40) sizeof EQU * ; size: $2C (44) ENDR ; typedef struct ActionHandlerPB ActionHandlerPB ; typedef ActionHandlerPB *ActionHandlerPBPtr ENDIF ; __INSTALLERSCRIPT__